package nl.ypmits.utils.as3.bitmap {
	import flash.display.Bitmap;	import flash.display.BitmapData;	import flash.display.DisplayObject;	import flash.geom.Matrix;			/**	 * @author davelenz	 */	public class BitmapConverter {
		public static function convertToBitmap( obj : DisplayObject, smoothing : Boolean = false, translationsMatrix : Matrix = null ) : Bitmap {
			var bitmapdata : BitmapData = new BitmapData( obj.width, obj.height, true, 0xFF9900 );

			var newbitmap : Bitmap = new Bitmap( bitmapdata );
			bitmapdata.draw( obj, translationsMatrix );
			newbitmap.smoothing = smoothing;
			
			return newbitmap;
		}
		
		
		public static function convertSpecialSize( obj : DisplayObject, smoothing : Boolean = false, w:Number = 100, h:Number = 100 ) : Bitmap {
			var m : Matrix = new Matrix( );
			var bitmapdata : BitmapData = new BitmapData( w, h, true, 0xFF9900 );
			
			var newbitmap : Bitmap = new Bitmap( bitmapdata );
			bitmapdata.draw( obj, m );
			newbitmap.smoothing = smoothing;
			
			return newbitmap;
		}
	}}